Add [\!shouldfail] reproducer for transitive implicit-dep tracking bug#50
Merged
Conversation
Minimal fixture demonstrating that pup fails to record a newly-transitive header when an existing tracked header is edited to include it. After the edit, the source's recompile produces a .d file listing the new header, but pup's implicit-dep set is not extended — so subsequent edits to the new header are invisible to change detection and pup reports "Nothing to do" while the .o is stale. Reproducer (test.sh): 1. source.c includes only old.h. Build, record old.h as implicit dep. 2. Edit old.h to also #include newhdr.h. Rebuild. .o picks up new value via newhdr.h. 3. Edit newhdr.h. Rebuild expected; pup reports "Nothing to do". .o stale. Tagged [\!shouldfail] so default CI stays green while the bug is on file. Once the underlying dep-recording bug is fixed, removing the tag converts this into a regression guard. The bug reproduces unscoped (no scope filter) and is distinct from the change-detection scope-filter bug fixed in 315b2a2 — that one was about an existing recorded header being filtered out; this is about a header never being recorded in the first place. Refs pup-header-detection-bug.md (working notes). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a minimal failing reproducer for a real bug in pup's implicit-dep recording, tagged
[\!shouldfail]so CI stays green while the bug is on file. Usespup show index(just landed via #49) for forensic diagnostic output.The bug
When an already-tracked header is edited to
#includea new header, the source's recompile produces a.dfile listing the new header, but pup's index does not extend the source's implicit-dep set to include it. Subsequent edits to the newly-introduced header are then invisible to change detection — pup reportsNothing to do (up to date).while the.ois stale.This is distinct from the scope-filter bug fixed in 315b2a2. That one was an existing recorded header being filtered out during change detection. This is a header never recorded in the first place. It fires unscoped.
Reproducer (see
test/e2e/fixtures/header_dep_transitive/test.sh)main.cincludes onlyold.h. Initial build recordsold.has implicit dep..ocontains0x1(ANSWER=1). ✓old.hto#include "newhdr.h"and useEXTRA. Rebuild..ocontains0x64(EXTRA=100). ✓ (compile happened, .d listed newhdr.h)newhdr.h(EXTRA 100 → 7777). Rebuild expected. Observed:Nothing to do..ostays at0x64. ✗Between steps 2 and 3,
test.shrunspup show index PATTERNand reports whethernewhdr.happears inmain.c's implicit-dep set. Live result on this branch:This isolates the root cause precisely: pup's post-execution
.d-file processing does not extend the implicit-dep set with newly-discovered transitive headers. The bug is in the dep-recording path (arounddiscovered_deps/process_implicit_depsincmd_build.cpp), not in change detection.Why
[\!shouldfail]Catch2's
[\!shouldfail]marks the test as an expected-failure: it runs, output is captured, exit status reports1 failed as expected. Default CI stays green. Once the dep-recording bug is fixed and the test passes, removing the tag converts it into a regression guard.Test plan
bash test/e2e/fixtures/header_dep_transitive/test.shexits 1 with diagnostic output showing stale.oAND the forensic frompup show indexpinpointing the missing edge./build/test/unit/putup_test "[\!shouldfail]"reports1 failed as expectedmake formatcleanRefs
pup-header-detection-bug.md(working notes).🤖 Generated with Claude Code